package DataStructure.graph;

//有向边或无向边
public class Edge {
    private int v;
    private int w;
    private double weight;//权重

    public Edge(int v, int w, double weight) {
        this.v = v;
        this.w = w;
        this.weight = weight;
    }
    public Edge(int v,int w){
        this(v,w,1);
    }

    public double weight(){
        return weight;
    }
    public int from(){
        return v;
    }
    public int to(){
        return w;
    }
}
